_AAAA_CCCC______SSSS_TTTT_AAAA_RRRR_TTTT Starts kernel, daemon, or record accounting;
sets cpu time or memory threshold.
_AAAA_CCCC______SSSS_TTTT_OOOO_PPPP Stops kernel, daemon, or record accounting.
_AAAA_CCCC______HHHH_AAAA_LLLL_TTTT Stops all kernel, daemon, and record
accounting.
_AAAA_CCCC______CCCC_HHHH_EEEE_CCCC_KKKK Checks a kernel, daemon, or record accounting
state.
_AAAA_CCCC______KKKK_DDDD_SSSS_TTTT_AAAA_TTTT Checks all kernel and daemon accounting
states.
_AAAA_CCCC______RRRR_CCCC_DDDD_SSSS_TTTT_AAAA_TTTT Checks all record accounting states.
_AAAA_CCCC______JJJJ_AAAA_SSSS_TTTT_AAAA_RRRR_TTTT Starts user job accounting.
_AAAA_CCCC______JJJJ_AAAA_SSSS_TTTT_OOOO_PPPP Stops user job accounting.
_AAAA_CCCC______WWWW_RRRR_AAAA_CCCC_CCCC_TTTT Writes accounting record for a daemon program.
_AAAA_CCCC______AAAA_UUUU_TTTT_HHHH Checks if caller has the necessary
capabilities for privileged _aaaa_cccc_cccc_tttt_cccc_tttt_llll calls
_a_c_t Points to either an actctl, actstat, or actwra structure,
depending on the function (that is, _f_n_c) to be performed. The
_aaaa_cccc_tttt_cccc_tttt_llll structure is used with _AAAA_CCCC______SSSS_TTTT_AAAA_RRRR_TTTT, _AAAA_CCCC______SSSS_TTTT_OOOO_PPPP, _AAAA_CCCC______KKKK_DDDD_SSSS_TTTT_AAAA_TTTT,
_AAAA_CCCC______RRRR_CCCC_DDDD_SSSS_TTTT_AAAA_TTTT, _AAAA_CCCC______JJJJ_AAAA_SSSS_TTTT_AAAA_RRRR_TTTT, and _AAAA_CCCC______JJJJ_AAAA_SSSS_TTTT_OOOO_PPPP functions. The actstat
structure is used with _AAAA_CCCC______CCCC_HHHH_EEEE_CCCC_KKKK function. The actwra structure is
used with the _AAAA_CCCC______WWWW_RRRR_AAAA_CCCC_CCCC_TTTT function.
This parameter is ignored for the _AAAA_CCCC______AAAA_UUUU_TTTT_HHHH function.
The _AAAA_CCCC______SSSS_TTTT_AAAA_RRRR_TTTT, _AAAA_CCCC______SSSS_TTTT_OOOO_PPPP, _AAAA_CCCC______HHHH_AAAA_LLLL_TTTT, and _AAAA_CCCC______WWWW_RRRR_AAAA_CCCC_CCCC_TTTT functions require the
CAP_ACCT_MGT capability. See the capability(4) and capabilities(4) man
pages for more information on the capability mechanism that provides fine
grained control over the privileges of a process.
If the type of accounting you specified already is enabled and the path
information in the actctl structure differs from the accounting file
currently in use, the accounting file will be switched to the new path
without losing any accounting information.
Only a process with appropriate privilege can use this system call to
enable or disable accounting. However, privilege is not required to
check the status of accounting.
EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
The following example shows how to write an NQS daemon accounting record.
Similar code would be written for other daemon accounting record types.
You need to use the following include statements:
#include <sys/types.h>
#include <sys/time.h>
#include <sys/acct.h>
#include <csaacct.h>
#include <optional_sym.h>
...
To write a daemon accounting record within a procedure, see the following
example:
struct nqsbs nqsbs;
struct actwra actwra;
memset((char *)&nqsbs, 0, sizeof(nqsbs));
nqsbs.hdr.ah_magic = ACCT_MAGIC;
nqsbs.hdr.ah_revision = REV_NQS;
nqsbs.hdr.ah_type = ACCT_DAEMON_NQS;
nqsbs.hdr.ah_flag = 0;
nqsbs.hdr.ah_size = sizeof(nqsbs);
nqsbs.type = type;
nqsbs.subtype = subtype;
nqsbs.jid = jid;
nqsbs.time = time(0);
/* convert time values from clock ticks to microseconds */